from flask import jsonify

def success_response(message="操作成功", data=None):
    return {
        "code": 200,
        "message": message,
        "data": data
    }

def error_response(message="操作失败", code=400):
    return {
        "code": code,
        "message": message,
        "data": None
    }

def api_response(code, message, data):
    """统一返回 Flask 响应对象"""
    return jsonify({
        "code": code,
        "message": message,
        "data": data
    })
